<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>消除魔术字符串</title>
</head>
<body>
    <h1>实例：消除魔术字符串</h1>

    <script>
        const shapeType = {
            triangle: Symbol('triangle'),
            circle: Symbol('circle')
        };

        function getArea(shape) {
            switch (shape) {
                case shapeType.triangle:
                    return "三角形面积计算";
                case shapeType.circle:
                    return "圆形面积计算";
            }
        }

        console.log(getArea(shapeType.triangle)); // "三角形面积计算"
    </script>
</body>
</html> 